#include "stdafx.h"



void SettingsInit() {
}

Settings::Settings() {
	TestSettingsString = "Test string!";
}

HRESULT Settings::LoadSettings() {
	if(OpenContent("save", "SettingsFile", L"Settings", 0xFF) != S_OK)
		return S_FALSE;

	if(settingsIni.LoadFile("save:\\savegame.txt") < SI_OK) {
		if(SaveSettings() == S_OK)
			return LoadSettings();
		return S_FALSE;
	}

	TestSettingsString = settingsIni.GetValue("XePS2", "Test", "DefaultValue");

	CloseContent("save");
	
	return S_OK;
}

HRESULT Settings::SaveSettings() {

	settingsIni.SetValue("XePS2", "Test", "Saved Value");

	if(OpenContent("save", "SettingsFile", L"Settings", 0xFF) != S_OK)
		return S_FALSE;

	settingsIni.SaveFile("save:\\savegame.txt");

	CloseContent("save");

	return S_OK;
}